// distributor/index/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    order_list: [],
    page: 0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (a) {
    getApp().pageOnLoad(this, a);
    var that = this;
    that.getOrder()
  },

  // 获取数据
  getOrder: function () {
    var that = this;
    getApp().request({
      url: getApp().api.distributor.get_order_log,
      data: {
          page: that.data.page
      },
      success: function(t) {
          if (t.code == 0) {
            var list = that.data.order_list.concat(t.data.list);
            that.setData({
              order_list: list,
              page:++that.data.page,
            })
          }
      }
    });
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    getApp().pageOnShow(this);
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.getOrder()
  },
  goUrl: function (t) {
    var url =t.currentTarget.dataset.url
    console.log(url,t)
    wx.navigateTo({
      url: url,
    })
  },


})